<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 13. Boost.Function</title>
<link rel="stylesheet" href="../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="libraries.html" title="Part I. The Boost C++ Libraries (BoostBook Subset)">
<link rel="prev" href="foreach/history_and_acknowledgements.html" title="History and Acknowledgements">
<link rel="next" href="function/history.html" title="History &amp; Compatibility Notes">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../boost.png"></td>
<td align="center"><a href="../../index.html">Home</a></td>
<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="foreach/history_and_acknowledgements.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.html"><img src="../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="function/history.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="chapter">
<div class="titlepage"><div>
<div><h2 class="title">
<a name="function"></a>Chapter 13. Boost.Function</h2></div>
<div><div class="author">
<h3 class="author">
<span class="firstname">Douglas</span> <span class="surname">Gregor</span>
</h3>
<code class="email">&lt;<a class="email" href="mailto:dgregor%20-at-%20cs.indiana.edu">dgregor -at- cs.indiana.edu</a>&gt;</code>
</div></div>
<div><p class="copyright">Copyright © 2001-2004 Douglas Gregor</p></div>
<div><div class="legalnotice">
<a name="id-1.3.14.1.3"></a><p>Use, modification and distribution is subject to the Boost
    Software License, Version 1.0. (See accompanying file
    <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
</div></div>
</div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl class="toc">
<dt><span class="section"><a href="function.html#function.intro">Introduction</a></span></dt>
<dt><span class="section"><a href="function/history.html">History &amp; Compatibility Notes</a></span></dt>
<dt><span class="section"><a href="function/tutorial.html">Tutorial</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="function/tutorial.html#id-1.3.14.5.4">Basic Usage</a></span></dt>
<dt><span class="section"><a href="function/tutorial.html#id-1.3.14.5.5">Free functions</a></span></dt>
<dt><span class="section"><a href="function/tutorial.html#id-1.3.14.5.6">Member functions</a></span></dt>
<dt><span class="section"><a href="function/tutorial.html#id-1.3.14.5.7">References to Function Objects</a></span></dt>
<dt><span class="section"><a href="function/tutorial.html#id-1.3.14.5.8">Comparing Boost.Function function objects</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="function/reference.html">Reference</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="function/reference.html#function.definitions">Definitions</a></span></dt>
<dt><span class="section"><a href="function/reference.html#header.boost.function_hpp">Header &lt;boost/function.hpp&gt;</a></span></dt>
<dt><span class="section"><a href="function/reference.html#header.boost.function_equal_hpp">Header &lt;boost/function_equal.hpp&gt;</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="function/faq.html">Frequently Asked Questions</a></span></dt>
<dt><span class="section"><a href="function/misc.html">Miscellaneous Notes</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="function/misc.html#id-1.3.14.8.2">Boost.Function vs. Function Pointers</a></span></dt>
<dt><span class="section"><a href="function/misc.html#id-1.3.14.8.3">Performance</a></span></dt>
<dt><span class="section"><a href="function/misc.html#id-1.3.14.8.4">Combatting virtual function "bloat"</a></span></dt>
<dt><span class="section"><a href="function/misc.html#id-1.3.14.8.5">Acknowledgements</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="function/testsuite.html">Testsuite</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="function/testsuite.html#function.testsuite.acceptance">Acceptance tests</a></span></dt>
<dt><span class="section"><a href="function/testsuite.html#function.testsuite.negative">Negative tests</a></span></dt>
</dl></dd>
</dl>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="function.intro"></a>Introduction</h2></div></div></div>
<p>The Boost.Function library contains a family of class templates
that are function object wrappers. The notion is similar to a
generalized callback. It shares features with function pointers in
that both define a call interface (e.g., a function taking two integer
arguments and returning a floating-point value) through which some
implementation can be called, and the implementation that is invoked
may change throughout the course of the program.</p>
<p> Generally, any place in which a function pointer would be used
to defer a call or make a callback, Boost.Function can be used instead
to allow the user greater flexibility in the implementation of the
target. Targets can be any 'compatible' function object (or function
pointer), meaning that the arguments to the interface designated by
Boost.Function can be converted to the arguments of the target
function object.</p>
</div>
</div>
<div class="copyright-footer"></div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="foreach/history_and_acknowledgements.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.html"><img src="../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="function/history.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
